<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width"/>
        <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
        <title>统战成员学习平台</title>
	    <link rel="stylesheet" type="text/css" href="../../css/base.css" />
	    <link rel="stylesheet" type="text/css" href="../../css/style.css" />
    </head>
    <body>
        <header class="red">
            <div class="ui_border_b">
                <span tapmode onclick="closeWin()" class="left"><i class="icon_back_white"></i></span>
                <div class="search">
                    <input type="text" id="courseName">
                    <span tapmode onclick="clearInput()"><i class="icon_clear"></i></span>
                </div>
                <span tapmode onclick="search()" class="right">搜索</span>
            </div>
    	</header>
        <div class="top_shadow"></div>
        <script type="text/javascript" src="../../script/api.js"></script>
		<script type="text/javascript" src="../../script/vue.min.js"></script>
        <script type="text/javascript" src="../../script/common.js"></script>
        <script type="text/javascript" src="../../script/layer_mobile/layer.js"></script>
        <script type="text/javascript">

            apiready = function(){
                api.parseTapmode();
                var header = $api.dom('header');
                $api.fixStatusBar(header);
                sbsm.opened();
                var headerPos = $api.offset(header);
                api.openFrame({
                    name: 'search_frm',
                    url: './search_frm.html',
                    bounces: true,
                    rect: {
                        x: 0,
                        y: headerPos.h + 10,
                        w: 'auto',
                        h: 'auto'
                    },
                    pageParam: {},
            		hScrollBarEnabled: false,
            		vScrollBarEnabled: true
                });
                setTimeout(function() {
                    courseName.focus();
                }, 1000)
            };

            function search() {
                api.sendEvent({
                    name: 'search_course_event',
                    extra: {
                        courseName: courseName.value
                    }
                });
            }

            function clearInput() {
                courseName.value = '';
                courseName.focus();
                api.sendEvent({
                    name: 'clear_search_course_event'
                });
            }

            function subInput(e) {
              var keyCode =window.event? e.keyCode:e.which;
              if(keyCode == 13)
              {
                //按下了回车键
                search();
              }
            }

            document.getElementById('courseName').onkeydown=subInput;
        </script>
    </body>
</html>
